@extends('admin.layout.main')
@section('content')
    <div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
        <ul class="layui-tab-title site-demo-title">
            <li class="layui-this"><a href="javascript:location.reload()">角色管理</a></li>
        </ul>
        <div class="layui-body layui-tab-content site-demo site-demo-body">
            <div class="layui-main">
                <a class="layui-btn" href="/admin/roles/create">添加</a>
            </div>

            <div class="layui-tab-item layui-show">
                <div class="layui-main">
                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
                        <legend>角色管理</legend>
                    </fieldset>
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>角色名</th>
                            <th>描述</th>
                            <th>创建时间</th>
                            <th>修改时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        @foreach($roles as $role)
                            <tr>
                                <td>{{$role->id}}</td>
                                <td>{{$role->name}}</td>
                                <td>{{$role->description}}</td>
                                <td>{{$role->created_at}}</td>
                                <td>{{$role->updated_at}}</td>
                                <td><a class="layui-btn layui-btn-normal"
                                       href="/admin/roles/{{$role->id}}/permission">权限管理</a>
                                </td>
                            </tr>
                        @endforeach
                    </table>

                </div>
            </div>
        </div>
    </div>
@endsection
<script>

</script>
